package com.mingqijia.gassafety.db.mapper;

import com.mingqijia.gassafety.db.entity.HistoryBroken;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mingqijia.gassafety.db.entity.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 报警器设备故障记录 Mapper 接口
 * </p>
 *
 * @author wanghai
 * @since 2022-08-08
 */
@Mapper
@Repository
public interface HistoryBrokenMapper extends BaseMapper<HistoryBroken> {

    List<HistoryBrokenVO> getBrokenList(LatestLogListVO params);

    List<HistoryBrokenVO> getRecordWithType1(LatestLogListVO vo);

    List<HistoryBrokenVO> getRecordWithType2(LatestLogListVO vo);

    List<HistoryBrokenVO> getVccRecord(LatestLogListVO vo);

    List<HistoryBrokenVO> getBrokenRecord();

    List<HistoryBrokenVO> getAsstRecord(LatestLogListVO vo);

    GetCondtionListVo getConditionList(@Param("spIds") List<String> spIds, @Param("funcCodes") List<String> funcCodes);

    Long getTotalRows();

    void batchUpdate(@Param("startRow") Integer startRow, @Param("batchSize") Integer batchSize);

    List<DeviceBrokenDataVO> deviceBrokenData(@Param("spIds") List<String> spIds);

    Integer deviceBrokenCount(@Param("spIds") List<String> spIds);

    List<HistoryBrokenVO> warningInfoGas(IndustryScreenWarningVo vo);

    //时间段内设备故障总数
    Integer quantumBrokenCount(@Param("spIds") List<String> spIds,@Param("firstDayOfMonth") LocalDate firstDayOfMonth,@Param("lastDayOfMonth") LocalDate lastDayOfMonth);

    List<HistoryBrokenVO> industryBorkenRecord(LatestLogListVO vo);

    //根据客户id进行查询
    List<HistoryBroken> selectByCustomerId(Integer customerId);
}
